﻿using School;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;

namespace School.Test
{
    [TestClass()]
    public class StudentTest
    {
        private TestContext testContextInstance;
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        [TestMethod()]
        public void StudentConstructorTestGivenFacultyNumber_1_AndName_Ivan_ExpectedFacultyNumber_1_AndName_Ivan()
        {
            string studentName = "Ivan";
            int studentFacultyNumber = 1;
            Student target = new Student(studentFacultyNumber, studentName);
            Assert.AreEqual(target.FacultyNumber, 1,
                string.Format("Given {0}, Expected {1}, Actual {2}", studentFacultyNumber, 
                studentFacultyNumber, target.FacultyNumber));
            Assert.AreEqual(target.Name,"Ivan",
                string.Format("Given {0}, Expected {1}, Actual {2}", studentName, 
                studentName, target.Name));
        }

        [TestMethod()]
        public void EqualsTestGivenStudentAndNullTarget_ExpectedNotEqualResult()
        {
            string studentName = "Ivan";
            int studentFacultyNumber = 1;
            Student target = new Student(studentFacultyNumber,studentName);
            object obj = string.Empty;
            bool expected = false;
            bool actual = target.Equals(obj);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void EqualsTestGivenStudentsWithDifferentFacultyNumbersExpectedNotEqualResult()
        {
            string studentOneName = "Ivan";
            int studentOneFacultyNumber = 1;
            Student target = new Student(studentOneFacultyNumber, studentOneName);
            string studentTwoName = "Ivan";
            int studentTwoFacultyNumber = 2;
            Student value = new Student(studentOneFacultyNumber, studentOneName);
            bool expected = false;
            bool actual = target.Equals(value);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for GetHashCode
        ///</summary>
        [TestMethod()]
        public void GetHashCodeTest()
        {
            Student target = new Student(); // TODO: Initialize to an appropriate value
            int expected = 0; // TODO: Initialize to an appropriate value
            int actual;
            actual = target.GetHashCode();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for ToString
        ///</summary>
        [TestMethod()]
        public void ToStringTest()
        {
            Student target = new Student(); // TODO: Initialize to an appropriate value
            string expected = string.Empty; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.ToString();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for FacultyNumber
        ///</summary>
        [TestMethod()]
        public void FacultyNumberTest()
        {
            Student target = new Student(); // TODO: Initialize to an appropriate value
            string expected = string.Empty; // TODO: Initialize to an appropriate value
            string actual;
            target.FacultyNumber = expected;
            actual = target.FacultyNumber;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest()
        {
            Student target = new Student(); // TODO: Initialize to an appropriate value
            string expected = string.Empty; // TODO: Initialize to an appropriate value
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
    }
}
